<template>
  <a-config-provider :locale="zh_CN">
    <router-view v-slot="{ Component }">
      <transition name="fade">
        <div>
          <component :is="Component" />
        </div>
      </transition>
    </router-view>
    <!--   全局loading效果  -->
    <div v-if="showPageLoading" class="global-loading">
      <loading></loading>
    </div>
  </a-config-provider>
</template>

<script setup lang="ts">
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
import moment from 'moment';
import { computed, ref } from 'vue';
import { useStore } from 'vuex';
import Loading from 'lib-comp/loading/loading.vue';
// 引入moment
moment.locale('zh-cn');//配置moment中文环境
const store = useStore()
const showPageLoading = computed(() => {
  return store.state.common.showPageLoading
})
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
</style>
<style lang="less" scoped>
.global-loading {
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: @zIndexLevel1;
}
</style>
